package com.soft.javase.day12.bank;

/**
 * @author yzh
 * @desc TODO
 * @date 2025/5/19
 */
public class AccountTest {
    public static void main(String[] args) {
        Account account = new Account(1500);

        for (int i = 1; i <= 5; i++) {
            new Thread(() -> {
                while (account.withdraw(200)) {
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }, "用户" + i).start();
        }
    }
}
